home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / circuits / pcb-1.000 / pcb-1 / pcb-1.3 / Imakefile < prev    next >
Makefile  |  1995-02-26  |  9KB  |  279 lines

  1. /*
  2.  *                            COPYRIGHT
  3.  *
  4.  *  PCB, interactive printed circuit board design
  5.  *  Copyright (C) 1994,1995 Thomas Nau
  6.  *
  7.  *  This program is free software; you can redistribute it and/or modify
  8.  *  it under the terms of the GNU General Public License as published by
  9.  *  the Free Software Foundation; either version 2 of the License, or
  10.  *  (at your option) any later version.
  11.  *
  12.  *  This program is distributed in the hope that it will be useful,
  13.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  *  GNU General Public License for more details.
  16.  *
  17.  *  You should have received a copy of the GNU General Public License
  18.  *  along with this program; if not, write to the Free Software
  19.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  *
  21.  *  Contact addresses for paper mail and Email:
  22.  *  Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
  23.  *  Thomas.Nau@rz.uni-ulm.de
  24.  *
  25.  *  RCS: $Header: /sda4/users/nau/src/pcb/RCS/Imakefile,v 2.5 1994/10/29 17:29:04 nau Exp $
  26.  */
  27.  
  28. /* ------------------- start of user configuration ---------------------------
  29.  *
  30.  *   INFODIR:     where to install the GNU-info files
  31.  *   PCBLIBDIR:   where to install fonts...
  32.  *   CIRCUITDIR:  where to install circuits...
  33.  *   PACKAGEDIR:  where to install packages...
  34.  * it is set, for example, to /usr/lib/X11/pcb (LIBDIR is defined by imake)
  35.  *
  36.  */
  37. INFODIR = /usr/local/info
  38. PCBLIBDIR = $(LIBDIR)/pcb
  39. CIRCUITDIR = $(PCBLIBDIR)/circuits
  40. PACKAGEDIR = $(PCBLIBDIR)/packages
  41.  
  42. /* ----------------------------------------------------------------------
  43.  * BTNMOD determies the modifier key to be used for the
  44.  * function key and buttons in the default translations.
  45.  * The default, <mod1>, works fine if you do not use the HP-VUE
  46.  * window manager which uses <mod1> itself. It's save to use <ctrl> instead.
  47.  */
  48. BTNMOD = Mod1
  49.  
  50. /* ----------------------------------------------------------------------
  51.  * You will probably need an additional searchpath for include files
  52.  * if you use OpenWindows
  53.  */
  54. /* EXTRA_INCLUDES  = -I/usr/openwin/include */
  55.  
  56. /* ----------------------------------------------------------------------
  57.  * Check the following section of architecture dependend settings.
  58.  * If there's a #ifdef - #endif pair for your machine fine; if
  59.  * not you may create a new one (and mail it to the author too if
  60.  * it works) or try the default. Here's some more information:
  61.  *
  62.  * if your system supports atexit() define EXITCALL as -DHAS_ATEXIT
  63.  * if your system has on_exit() but no atexit() like suns with BSD
  64.  * define it as -DHAS_ON_EXIT
  65.  *
  66.  * setup the system libraries needed for lex (flex), also add -lm
  67.  *
  68.  * a symbol PATCHES is used to pass additional information to
  69.  * the compiler. Additional options are:
  70.  *   -DNEED_STRDUP       if your system doesn't have strdup()
  71.  */
  72. /* PATCHES = -DNEED_STRDUP */
  73.  
  74. /* ----------------------------------------------------------------------
  75.  * some default values which can be changed in the architecture
  76.  * depending section
  77.  */
  78. SYS_LIBRARIES = -ll -lm         /* these are the default libraries */ 
  79. #ifdef SYSV                     /* System V has atexit() */
  80.       EXITCALL = -DHAS_ATEXIT
  81. #endif
  82.  
  83. /* ----------------------------------------------------------------------
  84.  * the architecture depending section
  85.  */
  86. #ifdef AnsiDefines              /* some ANSI CC need additional defines */
  87.      EXTRA_DEFINES  = AnsiDefines
  88. #endif
  89.  
  90. #ifdef LinuxArchitecture        /* LINUX */
  91.       SYS_LIBRARIES = -lfl -lm
  92.       EXITCALL = -DHAS_ATEXIT
  93. #endif
  94.  
  95. #ifdef SGIArchitecture          /* Silicon Graphics */
  96.       CCOPTIONS = -D__STDC__    /* thanks to Bernd Leibing */
  97.       PROTO_DEFINES =           /* Bernd.Leibing@e-technik.uni-ulm.de */
  98.       EXITCALL = -DHAS_ATEXIT
  99. #endif
  100.  
  101. #ifdef HPArchitecture           /* HP */
  102.       EXITCALL = -DHAS_ATEXIT
  103. #endif
  104.  
  105. #ifdef SunArchitecture          /* Sun */
  106. #if OSMajorVersion < 5          /* BSD */
  107.       EXITCALL = -DHAS_ON_EXIT
  108. #else                           /* Solaris */
  109.       EXITCALL = -DHAS_ATEXIT
  110. #endif
  111. #endif
  112.  
  113. #ifdef ArmArchitecture          /* Acorn RISCiX, BSD libraries */
  114.       EXITCALL = -DHAS_ATEXIT   /* thanks to Adrian Godwin */
  115.                                 /* agodwin@acorn.co.uk */
  116.                                 /* the BSD environment does not define M_PI */
  117.       PATCHES = -DNEED_STRDUP
  118.       CC = /usr/ucb/cc
  119. #endif
  120.  
  121. /* ------------------- end of user configuration ------------------------- */
  122.  
  123. RELEASE = 1.3
  124.  
  125. COMPRESS = gzip
  126. SUFFIX   = gz
  127.  
  128. DEFINES = -DRELEASE=\"$(RELEASE)\" $(EXITCALL) \
  129.           -DCIRCUITDIR=\"$(CIRCUITDIR)\" \
  130.           -DPACKAGEDIR=\"$(PACKAGEDIR)\" \
  131.           -DPCBLIBDIR=\"$(PCBLIBDIR)\" \
  132.           -DBTNMOD=\"$(BTNMOD)\" \
  133.           $(PATCHES)
  134.  
  135. PROGRAMS = pcb
  136.  
  137. SRCS = parse_y.c parse_l.c \
  138.  action.c buffer.c change.c command.c control.c copy.c create.c crosshair.c \
  139.  data.c dialog.c draw.c error.c file.c fileselect.c find.c log.c \
  140.  main.c mymem.c menu.c mirror.c misc.c move.c \
  141.  pinout.c polygon.c print.c printdialog.c printpanner.c \
  142.  remove.c rotate.c search.c select.c set.c sizedialog.c undo.c
  143.  
  144. OBJS = parse_y.o parse_l.o \
  145.  action.o buffer.o change.o command.o control.o copy.o create.o crosshair.o \
  146.  data.o dialog.o draw.o error.o file.o fileselect.o find.o log.o \
  147.  main.o mymem.o menu.o mirror.o misc.o move.o \
  148.  pinout.o polygon.o print.o printdialog.o printpanner.o \
  149.  remove.o rotate.o search.o select.o set.o sizedialog.o undo.o
  150.  
  151. FONTS = default_font
  152.  
  153. ADDITIONALDIR =   circuits packages README_FILES doc
  154.  
  155. DEPLIBS =         $(DEPXAWLIB) $(DEPXTOOLLIB) $(DEPEXTENSIONLIB) $(DEPXLIB) 
  156. LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB) 
  157.  
  158. /*
  159.  * add
  160.  *   all::
  161.  *   depend::
  162.  * rules to make sure that the parser files have been generated before
  163.  * the dependencies are checked
  164.  */
  165. all:: pcb Pcb.ad pcb.man
  166.  
  167. depend:: parse_l.c parse_y.c
  168.  
  169. ComplexProgramTarget(pcb)
  170. InstallManPage(pcb,$(MANDIR))
  171. InstallAppDefaults(Pcb)
  172. InstallMultipleFlags($(FONTS), $(PCBLIBDIR), $(INSTLIBFLAGS))
  173. InstallMultipleDestFlags(install.info, pcb.info, $(INFODIR), $(INSTLIBFLAGS))
  174.  
  175. install::
  176.     MakeDir($(CIRCUITDIR))
  177.     @case '${MFLAGS}' in *[i]*) set +e;; esac;     \
  178.     for i in `ls circuits` ; do                 \
  179.         (set -x; $(INSTALL) -c $(INSTDATFLAGS) circuits/$$i $(CIRCUITDIR));    \
  180.     done
  181.     MakeDir($(PACKAGEDIR))
  182.     @case '${MFLAGS}' in *[i]*) set +e;; esac;     \
  183.     for i in `ls packages` ; do                 \
  184.         (set -x; $(INSTALL) -c $(INSTDATFLAGS) packages/$$i $(PACKAGEDIR));    \
  185.     done
  186.  
  187. sed.script: Imakefile create_sed_script.sh const.h
  188.     @echo "creating sed-script from defines"
  189.     @./create_sed_script.sh $(DEFINES) Imakefile > $@
  190.  
  191. pcb.man: pcb.man.raw sed.script
  192.     @echo "creating manual from raw file"
  193.     @sed -f sed.script  < pcb.man.raw > $@
  194.  
  195. Pcb.ad: Pcb.ad.raw sed.script
  196.     @echo "creating application default resource from raw file"
  197.     @sed -f sed.script  < Pcb.ad.raw > $@
  198.  
  199. pcb.texi: pcb.texi.raw sed.script
  200.     @echo "creating pcb.texi from raw file"
  201.     @sed -f sed.script  < pcb.texi.raw > $@
  202.  
  203. pcb.info: pcb.texi
  204.     @echo "creating pcb.info file"
  205.     @makeinfo --no-split pcb.texi
  206.  
  207. pcb.dvi: pcb.texi
  208.     @echo "creating pcb.dvi file"
  209.     @tex pcb.texi; texindex pcb.fn pcb.vr pcb.cp; tex pcb.texi; tex pcb.texi
  210.  
  211. pcb.ps: pcb.dvi
  212.     @echo "creating $@ file"
  213.     @dvips -D 300 -o $@ pcb.dvi
  214.  
  215. refcard.tex: refcard.tex.raw sed.script
  216.     @echo "creating refcard.tex from raw file"
  217.     @sed -f sed.script  < refcard.tex.raw > $@
  218.  
  219. refcard.dvi: refcard.tex
  220.     @echo "creating refcard.dvi file"
  221.     @latex refcard.tex
  222.  
  223. refcard.ps: refcard.dvi
  224.     @echo "creating $@ file"
  225.     @dvips -D 300 -o $@ refcard.dvi
  226.  
  227. parse_y.h parse_y.c: parse_y.y global.h
  228.     $(YACC) -d parse_y.y
  229.     $(MV) y.tab.c parse_y.c
  230.     $(MV) y.tab.h parse_y.h
  231.  
  232. parse_l.c: parse_l.l parse_y.h global.h
  233.     $(LEX) parse_l.l
  234.     $(MV) lex.yy.c parse_l.c
  235.  
  236. default-doc::
  237.     make refcard.ps
  238.     $(COMPRESS) < refcard.ps > doc/refcard.ps.$(SUFFIX)
  239.     make pcb.ps
  240.     $(COMPRESS) < pcb.ps > doc/pcb.ps.$(SUFFIX)
  241.  
  242. new::
  243.     make clean
  244.     make
  245.  
  246. clean-doc::
  247.     $(RM) pcb.info pcb.dvi pcb.texi pcb.ps \
  248.         refcard.ps refcard.dvi refcard.tex \
  249.         pcb.man; \
  250.     for f in refcard pcb; do \
  251.         $(RM) $$f.log $$f.aux $$f.toc $$f.cps $$f.fns $$f.vrs \
  252.               $$f.cp $$f.fn $$f.ky $$f.pg $$f.tp $$f.vr; \
  253.     done;
  254.  
  255. clean::
  256.     make clean-doc
  257.     $(RM) parse_y.h parse_y.c parse_l.c sed.script Pcb.ad
  258.  
  259. distclean::
  260.     make clean
  261.     $(RM) Makefile
  262.  
  263. dist::
  264.     make distclean
  265.     @dir=/tmp/pcb-$(RELEASE); \
  266.         echo "creating public release `basename $$dir`, please be patient"; \
  267.         if [ -d $$dir ] ; then \
  268.             echo "can't create distribution, $$dir exists" >&2; exit 1; fi; \
  269.         mkdir $$dir; \
  270.         cp -p `find . -maxdepth 1 -type f -print` $$dir; \
  271.         cp -r $(ADDITIONALDIR) $$dir; \
  272.         (cd $$dir; make distclean); \
  273.         cd /tmp; \
  274.         prog=`basename $(COMPRESS)`; \
  275.         target=$$dir.tar.$(SUFFIX); \
  276.         tar cf - `basename $$dir` | $(COMPRESS) > $$target; \
  277.         rm -rf $$dir; \
  278.         echo "$$target is ready to be shipped"
  279.